#include <iostream>
using namespace std;
#include <vector>
#include <algorithm>

// 常用查找算法 adjacent_find
void test1()
{
    vector<int>v;
    v.push_back(10);
    v.push_back(30);
    v.push_back(50);
    v.push_back(20);
    v.push_back(40);
    v.push_back(20);
    v.push_back(20);

    vector<int>::iterator pos = adjacent_find(v.begin(), v.end());

    if (pos == v.end())
    {
        cout << "未找到相邻重复元素" << endl;
    }
    else
    {
        cout << "找到相邻重复元素：" << *pos << endl;
    }
}

int main()
{
    test1();
    return 0;
}